<template>
  <div>
    <!-- 分页器 -->
    <el-row type="flex" justify="end" align="middle" style="height:40px">
      <el-pagination
        :current-page="queryParams.page"
        :page-size="queryParams.pagesize"
        layout="total, prev, pager, next"
        :total="total"
        @current-change="handleCurrentChange"
      />
    </el-row>

  </div>
</template>

<script>
export default {
  props: {
    queryParams: {
      type: Object,
      default: null
    },
    total: {
      type: Number,
      default: 0
    }
  },
  methods: {
    // 点击切换页码
    handleCurrentChange(newPage) {
      // 通知父组件修改页码
      this.$emit('handleCurrentChange', newPage)
    }
  }

}
</script>

<style>

</style>
